package net.alche.fa.core.doing;
import net.alche.fa.core.model.Logic;
import net.alche.fa.core.model.FaValue;
import net.alche.fa.core.CodeLevel;
import net.alche.fa.core.SageStone;
import net.alche.fa.core.FaException;

//
// var
//
@FaAnnoDoing
public class ReturnDo extends AbstractDoing {

  @Override
  public boolean matched(String what, Logic g) {
    return "return".equals(what);
  }

  @Override
  public FaValue doing(Logic g, CodeLevel lvl, SageStone st) throws FaException {
    FaValue fav = super.getLogicObjVal(st, lvl, g);
    lvl.isReturn = true;
    return fav;
  }
}